home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
biblio
/
bibtex
/
utils
/
bibtools
/
bibkey.sed
< prev
next >
Wrap
Text File
|
1992-09-03
|
751b
|
33 lines
# bibkey.sed
#
# Goes with bin/bibkey - look for a word in the keyword entry
#
# David Kotz (dfk@cs.dartmouth.edu)
#
# On stdin, we get a lowercased bibtex file with comments stripped.
#
# On stdout, we produce a list of line numbers that are the starting
# line number of each reference, and the text of all "keyword"
# entries on separate lines.
# the idea is to get @ line numbers and all keywords
# @ entry
/^[ ]*@.*/=
# one-line keyword entry
s/[ ]*keyword[ ]*=[ ]*"\(.*\)".*/\1/p
t
# start of multi-line keyword entry
s/[ ]*keyword[ ]*=[ ]*"\(.*\)/\1/
t partial
b
# Handle multi-line keyword entry: save this line, repeatedly add
# lines until close quote forces output
:partial
N
s/\(.*\n.*\)".*/\1/
t done
b partial
:done
s/\n/ /g
p